import {ScrollView, View, Text, RichText} from '@tarojs/components';
import React, {Component} from 'react';
import Taro, {getCurrentInstance} from '@tarojs/taro';
import './index.less';

export default class Index extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }

  componentDidMount() {}

  componentDidShow() {}

  componentWillUnmount() {}

  render() {
    let giftsIntro = Taro.getStorageSync('giftsIntro');
    // 修改图片行内默认样式
    (Taro as any).options.html.transformElement = (el) => {
      if (el.nodeName === 'image') {
        el.setAttribute('mode', 'widthFix');
      }
      return el;
    };
    return (
      <ScrollView className="packageBIlustrate" scrollY>
        {/* <View  dangerouslySetInnerHTML={{__html: giftsIntro}} /> */}
        <RichText nodes={giftsIntro} space="nbsp"></RichText>
      </ScrollView>
    );
  }
}
